Micron Document
NexusPi Git Node

Commit 1b5aac740f8ca4164a268f97ede210aa7b70d8eb


Parents : de1e16a
Author : copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Signature : Signature validation error
Date : 2026-04-25T00:17:23Z
Committer : GitHub <noreply@github.com>
Date : 2026-04-25T00:17:23Z

Use isnan() for NaN checks in advertisement value validation

Agent-Logs-Url: https://github.com/jrl290/RTNode-HeltecV4/sessions/89412bfb-863f-4631-aa8d-1b3ceed34fbf

Co-authored-by: jrl290 <1811031+jrl290@users.noreply.github.com>

Changes

2 files changed, 3 insertions(+), 3 deletions(-)


Diff

diff --git a/BoundaryConfig.h b/BoundaryConfig.h
index 7b37e52..b6915a7 100755
--- a/BoundaryConfig.h
+++ b/BoundaryConfig.h
@@ -577,7 +577,7 @@ static void config_handle_save() {
boundary_state.advert_lat = 0.0;
} else {
double lat_val = lat_arg.toDouble();
- if (lat_val < -90.0 || lat_val > 90.0 || !(lat_val == lat_val)) {
+ if (lat_val < -90.0 || lat_val > 90.0 || isnan(lat_val)) {
lat_val = 0.0;
}
boundary_state.advert_lat = lat_val;
@@ -586,7 +586,7 @@ static void config_handle_save() {
boundary_state.advert_lon = 0.0;
} else {
double lon_val = lon_arg.toDouble();
- if (lon_val < -180.0 || lon_val > 180.0 || !(lon_val == lon_val)) {
+ if (lon_val < -180.0 || lon_val > 180.0 || isnan(lon_val)) {
lon_val = 0.0;
}
boundary_state.advert_lon = lon_val;

diff --git a/BoundaryMode.h b/BoundaryMode.h
index 63465f5..81cc8db 100755
--- a/BoundaryMode.h
+++ b/BoundaryMode.h
@@ -190,7 +190,7 @@ inline bool boundary_read_double(int addr, double& out) {
if (all_ff) return false;
memcpy(&out, buf, sizeof(out));
// Reject NaN / inf values that may slip in from corrupted EEPROM.
- if (!(out == out) || out > 1e9 || out < -1e9) return false;
+ if (isnan(out) || out > 1e9 || out < -1e9) return false;
return true;
}

Served by rngit 1.4.2 - Generated in 0.02s